package com.kehutong.department.controller;

import com.kehutong.common.util.Token;
import com.kehutong.department.service.ThridEmployeeService;
import job.ThirdEmployeeJob;
import org.coraframework.authz.HasPermission;
import org.coraframework.inject.Inject;
import org.coraframework.json.JSONObject;
import org.coraframework.logger.Logger;
import org.coraframework.logger.LoggerFactory;
import org.coraframework.mvc.MvcAction;
import org.coraframework.mvc.http.ReqMapping;
import org.coraframework.mvc.http.result.Result;

/**
 * TODO
 *
 * @author zhouweipeng
 * @version 1.0
 * @date 2021/9/8 13:41
 */
@MvcAction
@ReqMapping("/admin/third/employee")
public class ThirdEmployeeController {
    @Inject
    private ThridEmployeeService thridEmployeeService;
    private static final Logger logger = LoggerFactory.getLogger(ThirdEmployeeController.class);
    @HasPermission("employee:thirdform:view")
    @ReqMapping("/synThirdEmployee")
    public Object synThirdEmployee(Token token){
        try {
            thridEmployeeService.synEmployData(token);
        } catch (Exception e) {
            logger.error("同步员工出现异常！{}",e);
        }
        return Result.success();
    }

}
